package de.ars.client.items.animators;

import de.ars.client.animator.AbstractSlideItemAnimator;
import de.ars.client.animator.IAnimationEventListener;
import de.ars.client.paintSystems.ClassicLayout;

public class CallPersonItemAnimator extends AbstractSlideItemAnimator
{
    public static final float STANDARD_ANIMATION_SPEED = 2.5f;
    public static final float STANDARD_SCROLL_SPEED = 10.0f;
    
    public static final int POINT_ADD_PERSON_POS = 0;
    public static final int POINT_ADD_PERSON_SIZE = 1;
    public static final int POINT_ADD_PERSON_TEXT_POS = 2;
    
        private ClassicLayout layout;
        
        public CallPersonItemAnimator(IAnimationEventListener listener) 
        {
                super(listener);
        }
        
        public void setLayout(ClassicLayout layout)
    {
                this.layout = layout;
    }
        
        public void openItem()
        {
                this.startAnimationTo(POINT_ADD_PERSON_POS, this.layout.getAddPersonPos(), STANDARD_ANIMATION_SPEED);
                this.startAnimationTo(POINT_ADD_PERSON_TEXT_POS, this.layout.getAddPersonTextPos(), STANDARD_ANIMATION_SPEED);
                
                listener.animationEvent(IAnimationEventListener.ANIMATION_STARTED);
        }
        
        public void closeItem()
        {
                this.startAnimationTo(POINT_ADD_PERSON_POS, this.layout.getAddPersonClosePos(), STANDARD_ANIMATION_SPEED);
                this.startAnimationTo(POINT_ADD_PERSON_TEXT_POS, this.layout.getAddPersonCloseTextPos(), STANDARD_ANIMATION_SPEED);
                
                listener.animationEvent(IAnimationEventListener.ANIMATION_STARTED);
        }
}